/** 
 * File-Name:Queue.java
 *
 * Created on 2010-11-21 下午07:22:33
 * 
 * @author: Neo (neolimeng@gmail.com)
 * Software Engineering Institute, Peking University, China
 * 
 * Copyright (c) 2009, Peking University
 * 
 *
 */
package org.neocrawler.util;

/** 
 * Description:
 *
 * @author: Neo (neolimeng@gmail.com)
 * Software Engineering Institute, Peking University, China
 * @version 1.0  2010-11-21 下午07:22:33
 */
import java.util.LinkedList;

import org.neocrawler.entity.WebContent;

/**
 * 数据结构队列
 */
public class Queue<T> {

	private LinkedList<T> queue = new LinkedList<T>();

	public void enQueue(T t) {
		queue.addLast(t);
	}

	public T deQueue() {
		return queue.removeFirst();
	}

	public boolean isQueueEmpty() {
		return queue.isEmpty();
	}

	public boolean contians(T t) {
		return queue.contains(t);
	}

	public boolean empty() {
		return queue.isEmpty();
	}

	public int size() {
		return queue.size();
	}

	/**
	 * Description:
	 * 
	 * @param args
	 *            void
	 */
	public static void main(String[] args) {
		Queue<WebContent> queue = new Queue<WebContent>();
		WebContent webContent = new WebContent();
		webContent.setUrl("http://wur.com");

		queue.enQueue(webContent);
		System.out.println(queue.contians(webContent));

	}
}
